/* Copyright 2001,2002,2003 NAH6
 * All Rights Reserved
 *
 * Parts Copyright DoD, Parts Copyright Starium
 *
 */
/**************************************************************************
*
* ROUTINE
*               makefilt
*               makefilt_dynamic
*
* FUNCTION
*               defines and returns a filter structure
*               makefilt makes a filter with static coefficients
*               makefilt_dynamic makes a filter with changing coefficients
*
* SYNOPSIS
*               function makefilt(coef, f_order, data_length)
*               function makefilt_dynamic(f_order, data_length)
*
*   formal
*
*                       data    I/O
*       name            type    type    function
*       -------------------------------------------------------------------
*       coef            fxpt_16 i       order+1 filter coefficients
*       f_order         int     i       Filter order
*       data_length     int     i       Number of samples to filter
*
*       flt             FILTER  o       returned FILTER structure
*
***************************************************************************
*
* CALLED BY
*
*
*
* CALLS
*       filter.h
*
***************************************************************************/

#include "celpfilt.h"

FILTER makefilt(
fxpt_16 coef[],
int     f_order,
int     data_length)
{
        int i;
        FILTER flt;
        flt.order=f_order;
        flt.data_length=data_length;
        for (i=0; i<=f_order; i++)
        {
                flt.coef[i]=coef[i];
                flt.memory[i]=0;
        }
        return flt;
}

BIGFILTER makebigfilt(
fxpt_32 coef[],
int     f_order,
int     data_length)
{
        int i;
        BIGFILTER flt;
        flt.order=f_order;
        flt.data_length=data_length;
        for (i=0; i<=f_order; i++)
        {
                flt.coef[i]=coef[i];
                flt.memory[i]=0;
        }
        return flt;
}

FILTER makefilt_dynamic(
int     f_order,
int     data_length)
{
        int i;
        FILTER flt;
        flt.order=f_order;
        flt.data_length=data_length;
        for (i=0; i<=f_order; i++)
        {
                flt.memory[i]=0;
        }
        return flt;
}
